package com.itheima;

import java.util.Scanner;

public class Java_01 {
    public static void main(String[] args) {
        double rs = test(1000.00,"头等舱",9);
        System.out.println(rs);
    }
    //买飞机票
    public static double test(double price, String type,int date){
        //判断是旺季还是淡季
        //旺季
        if (date >= 5 && date <= 10){
            //判断机舱类型
            switch (type){
                case "头等舱":
                    price *= 0.9;
                    break;
                case "经济舱":
                    price *= 0.85;
                    break;
            }
        }
        else {
            //淡季
            switch (type){
                case "头等舱":
                    price *= 0.7;
                    break;
                case "经济舱":
                    price *= 0.65;
                    break;
            }
        }
    return price;
    }
}
